import java.util.Enumeration;
import java.util.Hashtable;

class SymbolTableElem {
	private Hashtable<String, Operand3a> table;

	public SymbolTableElem englobante;

	public SymbolTableElem(SymbolTableElem englo, int s) {
		table = new Hashtable<String, Operand3a>(s);
		englobante = englo;
	}

	public Operand3a lookup(String name) {
		Operand3a to;
		to = (Operand3a) table.get(name);
		if ((to == null) && (englobante != null))
			return englobante.lookup(name);
		else
			return to;
	}

	public void Insert(String name, Operand3a t) {
	    table.put(name, t);
// 		try {
// 			table.put(name, t);
// 		} catch (NullPointerException e) {
// 			System.out.println("\n Clef nulle!!!");
// 			System.exit(1);
// 		}
	}

	public void Affiche() {
		 for (Enumeration<String> e = table.keys(); e.hasMoreElements();){
			  String name = e.nextElement();
			  String elem = lookup(name).toString();
			  System.out.println(name + "-> "+elem);
		 }
		if (englobante != null)
			englobante.Affiche();
	}
}
